package com.kasax.skinchange

import android.app.Application
import android.widget.Toast
import java.io.File

class MyApp : Application() {
    override fun onCreate() {
        super.onCreate()

        val apkFile = File(getExternalFilesDir(null), "SkinPack-debug.apk")
        if (!apkFile.exists()) {
            val open = resources.assets.open("SkinPack-debug.apk")
            val outputStream = apkFile.outputStream()
            open.copyTo(outputStream)
            outputStream.close()
            open.close()
        }
        if (apkFile.exists()) {
            Toast.makeText(this, "皮肤包已经在存在了，可以放心使用了", Toast.LENGTH_LONG).show()
        }
    }
}